package com.java.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import com.java.connection.DatabaseConnection;
import com.java.domain.BookMasterAttributes;
public class LibraryDao extends DatabaseConnection implements  LibraryDaoI {

	
	public boolean setBookMasterData(String bookname, String bookauthor) {
	System.out.println(" In LibraryDao nBookName is:>>>>>> " + bookname
			+ " " + "BookAuthor is:>>>>>>> " + bookauthor);
	Connection conn = null;
	BookMasterAttributes bookMasterAttributes = null;
	try {                                                                                                                                                                                     
		conn = getConnection();
		String sql = " INSERT INTO BOOKMASTER (BOOKNAME, BOOKAUTHOR) VALUES (?,?) ";
		PreparedStatement pstmt = conn.prepareStatement(sql);
		pstmt.setString(1, bookname);
		pstmt.setString(2, bookauthor);
		
		
		int res = pstmt.executeUpdate();				
		System.out.println("res >>>>>>>>> : " + res);
		
		}
	
	 catch (Exception e) {
		System.err.println("Exception in getCustomer: " + e);
	} finally {
		closeConnection(conn);
	}
	return true;
	
}

}